/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package propres;
import java.util.*;
/**
 *
 * @author neochange
 */
public class CtrlVistaCliente extends CtrlVistaPersona
{

private CtrlDominioCliente driver2;
    
public CtrlVistaCliente(){
super();
driver2 = new CtrlDominioCliente();
}

public CtrlDominioCliente Get_contr(){
return driver2;
}
    
public String[] gestion_evento(String Y,String a,String b,String c,String d) throws Exception
{

    
    String[] D = new String[4];
    
    if(Y.equals("Dar Alta")){
    D[0]=a;
    D[1]=b;
    D[2]=c;
    D[3]=d;
    driver2.Alta_Persona(D);
    D = new String[4];
    }
    else if(Y.equals("Consultar Persona")){
    
     D=driver2.Consultar_Persona(c);
            
    }
    else if(Y.equals("Modificar Persona")){
    D[0]=a;
    D[1]=b;
    D[2]=c;
    D[3]=d;
    driver2.Modificar_Persona(D);
    D = new String[4];
    }
    else if(Y.equals("Eliminar Persona")){
    driver2.Eliminar_Persona(c);
    }
    
return D;    
}

public void guardar_objeto(String path) throws Exception
{
driver2.Guardar_cliente(path);
}

public void cargar_objeto(String pth) throws Exception
{
driver2.Cargar_cliente(pth);
}



public List<String> listar_cliente() throws Exception
{
return driver2.listcli();
}    
public CtrlDominioCliente Get_Ctrl() throws Exception
{
    return driver2;
}
public boolean existe_cliente(String Dni) throws Exception
{
    return driver2.existe_cliente(Dni);
}

public String[] comprovacion(String n, String a, String d, String dom,String action) throws Exception
{// devulve si las casillas son correctas o no y si no la razon
String[] o =driver2.comprobacion(n,a,d,dom,action);
    
return o;    
}

}
